extends Area2D

@onready var timer: Timer = $Timer


func _on_body_entered(body: Node2D) -> void:
	print("You died!")
	# 半速运行
	Engine.time_scale = 0.5
	body.get_node("CollisionShape2D").queue_free()
	timer.start()
	pass # Replace with function body.

# 定时器结束后自动运行
func _on_timer_timeout() -> void:
	# 恢复运行速度
	Engine.time_scale = 1
	get_tree().reload_current_scene()
	pass # Replace with function body.
